package org.mv.mm.docs.actions;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import org.mv.mm.docs.DocsTopComponent;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
import org.openide.awt.ActionReferences;
import org.openide.awt.ActionRegistration;
import org.openide.util.NbBundle.Messages;
import org.openide.windows.WindowManager;

@ActionID(category = "File",
id = "org.mv.mm.docs.DocsAction")
@ActionRegistration(displayName = "#CTL_DocsAction")
@ActionReferences({
  @ActionReference(path = "Menu/File", position = 1150)
})
@Messages("CTL_DocsAction=Documents")
public final class DocsAction implements ActionListener {

  @Override
  public void actionPerformed(ActionEvent e) {
    DocsTopComponent tc = new DocsTopComponent();
    WindowManager.getDefault().findMode("explorer").dockInto(tc);
    tc.open();
    tc.requestActive();
  }
}
